<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="/user/register" method="post">
          用户名:<input type="text" name="loginId" ><br>
        密码:<input type="password" name="loginPass" id="pass"><br>
        确认密码:<input type="password" name="loginpass" id="checkpass"><br>
        <button type="button" onclick="checkPass()">提交</button>
        <a href="/user/login" ></a>
    </form>
</body>
<script>
    function checkPass() {
        var pass = document.getElementById("pass").value;
        var checkpass = document.getElementById("checkpass").value;
        if(pass != checkpass){
            alert("两次密码不一致");
            return false;
        }else{
            document.getElementById("form");
            return true;
        }
    }
</script>
</html>